package com.framework.core.utils;

import android.util.Log;

/**
 * @author shenmengchao
 * @version 1.0.0
 * @date 2017/7/18
 * @description 日志打印 util
 */

public class LogUtil {

    public final static String TAG = "LOG";
    public static boolean sDebugEnable = true;
    public static boolean sErrorEnable = true;

    public static void config(boolean debugEnable, boolean errorEnable){
        sDebugEnable = debugEnable;
        sErrorEnable = errorEnable;
    }

    public static void d(String msg) {
        if (sDebugEnable) {
            Log.d(TAG, msg);
        }
    }

    public static void d(Class clz, String msg) {
        if (sDebugEnable) {
            Log.d(clz.getSimpleName(), msg);
        }
    }

    public static void e(String msg) {
        if (sErrorEnable) {
            Log.e(TAG, msg);
        }
    }

    public static void e(Class clz, String msg) {
        if (sErrorEnable) {
            Log.e(clz.getSimpleName(), msg);
        }
    }
}
